package com.meiyue.config;

import com.meiyue.config.interceptor.CustomInterceptor;
import com.meiyue.config.interceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * MeiyueJavaProject
 * com.meiyue.config
 * Created by Chris Chen
 * 2017/9/16
 * Explain:增加拦截器
 */
//@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
        registry.addInterceptor(new CustomInterceptor()).addPathPatterns("/**");
    }

}
